import { StatusBar, StyleSheet, useColorScheme } from 'react-native'
import React from 'react'
import { Stack } from 'expo-router'
import { Colors } from '../constants/Colors'

const RootLayout = () => {

  const colorScheme = useColorScheme()
  const theme = Colors[colorScheme] ?? Colors.light;

  return (
    <>
      <StatusBar value="auto" />
      <Stack screenOptions={{
        headerStyle: {
          // 背景颜色
          backgroundColor: theme.navBackground,
        },
        // 标题颜色
        headerTintColor: theme.navTitleColor,
      }}>
        {/* headerShown: false 隐藏header */}
        <Stack.Screen name="index" options={{title: '首页'}}/>
      </Stack>
    </>
  )
}

export default RootLayout

const styles = StyleSheet.create({})